import request from "../config/request.js";
import host from "../config/host";

const putEnergyConsumeElectricity = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/editEnergyConsumeElectricity", data, success, error);
};
const putEnergyConsumeWater = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/editEnergyConsumeWater", data, success, error);
};
const putEnergyConsumeNaturalGas = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/editEnergyConsumeNaturalGas", data, success, error);
};
const getEnergyConsumeElectricity = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/listEnergyConsumeElectricity", data, success, error);
};
const getEnergyConsumeWater = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/listEnergyConsumeWater", data, success, error);
};
const getEnergyConsumeNaturalGas = function(data, success, error) {
  request.postData(host.pcHostUrl + "/wx/energyConsume/listEnergyConsumeNaturalGas", data, success, error);
};
const getEnergyConsumeDetailElectricity = function(id, success, error) {
  request.getData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeElectricity/${id}`, success, error);
};
const getEnergyConsumeDetailWater = function(id, success, error) {
  request.getData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeWater/${id}`, success, error);
};
const getEnergyConsumeDetailNaturalGas = function(id, success, error) {
  request.getData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeNaturalGas/${id}`, success, error);
};
const getEnergyConsumeDetailListElectricity = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeForElectricity`, data, success, error);
};
const getEnergyConsumeDetailListWater = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeForWater`, data, success, error);
};
const getEnergyConsumeDetailListNaturalGas = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeForGas`, data, success, error);
};
const getEnergyConsumeChartByDay = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/countEnergyByDay`, data, success, error);
};
const getEnergyConsumeChartByMonth = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/countEnergyByMonth`, data, success, error);
};
const getEnergyConsumeRecordList = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/selectEnergyConsume`, data, success, error);
};
const getEnergyConsumeRecordDetail = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsumeForRecord`, data, success, error);
};
const postEnergyConsumeRecordEdit = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/editEnergyConsumeRecord`, data, success, error);
};

const getEnergyConsumeChartData = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/stat`, data, success, error);
};


const getEnergyConsumeDetail = function(id, success, error) {
  request.getData(`${host.pcHostUrl}/wx/energyConsume/detailEnergyConsume/${id}`, success, error);
};

const getEnergyConsumeDetailList = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/selectEnergyConsume`, data, success, error);
};
const postEnergyConsumeDetailEdit = function(data, success, error) {
  request.postData(`${host.pcHostUrl}/wx/energyConsume/editEnergyConsumer`, data, success, error);
};

const energyDictionary = function(success, error) {
  request.getData(`${host.pcHostUrl}/wx/energyConsume/energyDictionary`, success, error);
};

export default {
  putEnergyConsumeElectricity,
  putEnergyConsumeWater,
  putEnergyConsumeNaturalGas,
  getEnergyConsumeElectricity,
  getEnergyConsumeWater,
  getEnergyConsumeNaturalGas,
  getEnergyConsumeDetailElectricity,
  getEnergyConsumeDetailWater,
  getEnergyConsumeDetailNaturalGas,
  getEnergyConsumeDetailListElectricity,
  getEnergyConsumeDetailListWater,
  getEnergyConsumeDetailListNaturalGas,
  getEnergyConsumeChartByDay,
  getEnergyConsumeChartByMonth,
  getEnergyConsumeChartData,
  getEnergyConsumeRecordList,
  getEnergyConsumeRecordDetail,
  postEnergyConsumeRecordEdit,
  getEnergyConsumeDetail,
  getEnergyConsumeDetailList,
  postEnergyConsumeDetailEdit,
  energyDictionary
};
